Repository navigation
Surface workers blocked on a permission prompt (#31) - #54
Merged
currentbits merged 2 commits intoAug 15, 2026
Merged
Conversation
… IPC: full transcript pushed on every chunk; Markdown re-pars
A run stalled on a can_use_tool prompt stays "working" forever: thread_status never reported it, and the notification path only fired on done/failed. An unattended orchestration worker could sit blocked with nothing to show for it. - thread_status returns awaitingInput plus awaitingPermission (the prompt summary, via the runner's existing getPendingPermission). Guarded on status === "working", the same guard the sidebar badge uses, so a flag left behind by a run that died mid-prompt does not read as blocked. - shouldNotify gained a synthetic "waiting" state (working + awaitingInput): a blocked run in the background posts "needs permission", and the later waiting -> done/failed still notifies without re-firing on every push. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/worker-blocked-on-a-permission-prompt-st-91eed4
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31.
The problem
A run blocked on a
can_use_toolpermission prompt setsawaitingInput(runner.js) but stays at statusworking— and nothing downstream told anyone:thread_status(the orchestrator's MCP tool) returned only status / lastAssistantText / lastError, so an orchestrator polling a quiet worker saw "working" and nothing else.queueOrchNotice) fires only ondone/failed.shouldNotifyonly fired onworking -> done/working -> failed, so no desktop notification either.Net effect: an unattended worker sits blocked forever and the stall is invisible.
What changed
electron/orchServer.js—thread_statusnow returnsawaitingInput, plusawaitingPermission: what the run is actually asking for, read from the runner's existinggetPendingPermission(already used byipc.js, so no new plumbing).awaitingInputis guarded onstatus === "working"— the same guardSidebar.tsx:223uses — so a stale flag left behind by a run that died mid-prompt does not read as blocked. The tool description and the server INSTRUCTIONS now tell an orchestrator to check it when a worker goes quiet.electron/notify.js+electron/main.js—shouldNotifygained a synthetic"waiting"state (working + awaitingInput), derived in main.js by a smallthreadNotifyState()helper used both for the live push and the boot seed. A run that blocks while the window is in the background posts a "needs permission" notification; the laterwaiting -> done/failedstill notifies, andwaiting -> waitingdoes not re-fire on every push.What I deliberately did not do
Wake the orchestrator on
waiting. It cannot answer a permission prompt, so a notice would just make it spin — notifying the human is the actual unblock. The orchestrator can see the state viathread_statuswhen it wants it.Verification
node --test electron/test/notify.test.js→ 6/6 pass (new cases:working -> waiting, no re-fire onwaiting -> waiting,waiting -> done/failedstill notifies).orch-server tool handlerssuite passes, including a new test that a blocked worker reportsawaitingInput: truewith the prompt summary and that a stale flag on a failed thread reportsfalse.npm run typecheckclean.Full
npm run test:electronhas 25 failing suites in this environment (real-CLI / network dependent). The failure set is byte-identical before and after this change —diffof the twonot oklists produced no output.PR created by the Claude Code agent